﻿#region itdc

/************************************************************************
*Copyright(C) 2015 by qsgy
 *All rights reserved. 
 *FileName:     $safeitemname$
 *Author:       oyh
 *Version:      
 *UnityVersion：
 *Date:   $time$      
 *Description:    
 *History: 
************************************************************************/
#endregion
using UnityEngine;

public class PosInitial : MonoBehaviour {
    [Tooltip("其决定z坐标的中心点偏移. ")]
    public float deviation=0;
    
    private void Start()
    {
        Transform animat;
        animat = transform.Find(Helper.subAnimation);
#if DEBUG
        if (animat == null) Debug.LogError(name + "can't find animation");
#endif
        #region animation

        animat.position = new Vector3(animat.position.x, animat.position.y, transform.position.y+ deviation);
        #endregion
        Transform shadow = transform.Find(Helper.subShadow);
        if (shadow!=null)
        {
            shadow.position = new Vector3(shadow.position.x, shadow.position.y, animat.position.y+0.1f);//影子位置固定
        }
        GameManager.DestroyImmediate(this);
    }
}
